﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace John
{
    public partial class viste_lianxi : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                user();
            }

        }
        //private void update()
        //{
        //    string sql = "update muser set gsname='" + TextBox4.Text + "',adreess='" + TextBox5.Text + "',youbian='" + TextBox6.Text +
        //              "',zsname='" + TextBox7.Text + "',shouji='" + TextBox8.Text + "',guding='" + TextBox9.Text +
        //              "',qq='" + TextBox13.Text + "',email='" + TextBox10.Text + "',http='" + TextBox11.Text + "' where hyname='" + Request.Cookies["jisuanji110"].Value + "'";

        //    DBConn myDB = new DBConn();
        //    myDB.Update(sql);
        //    myDB.Close();
        //}

        private void user()
        {
            DBConn myDB = new DBConn();
            string sql = "select * from muser where hyname='" + Request.Cookies["jisuanji110"].Value + "'";
            SqlDataReader dr = myDB.getDataReader(sql);
            if (dr.Read())
            {
                TextBox4.Text = dr["gsname"].ToString();
                TextBox5.Text = dr["adreess"].ToString();
                TextBox6.Text = dr["youbian"].ToString();
                TextBox7.Text = dr["zsname"].ToString();
                TextBox8.Text = dr["shouji"].ToString();
                TextBox9.Text = dr["guding"].ToString();
                TextBox13.Text = dr["qq"].ToString();
                TextBox10.Text = dr["email"].ToString();
                TextBox11.Text = dr["http"].ToString();               
            }
            dr.Close();
            myDB.Close();
        }
    }
}